from datetime import datetime, timedelta, timezone
utc_dt = datetime.utcnow().replace(tzinfo=timezone.utc)
# 构建了 UTC 的当前时间
bj_dt = utc_dt.astimezone(timezone(timedelta(hours=8)))
# 将时区转化为东八区的时间
print(bj_dt)